/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gruppe1projekt.ModelLayer;

import java.util.ArrayList;
import java.util.Date;
import java.util.UUID;

/**
 *
 * @author Moulde
 */
public class Sale
{
    private ArrayList<Rent> Rents;
    private ArrayList<ProductSalesLine> saleLines;
    private Customer Customer;
    private Employee Employee;
    private Date Date;
    private String orderNumber;
    private boolean IsConcluded;

    public Sale(ArrayList<Rent> Rents, ArrayList<ProductSalesLine> saleLines, Customer Customer, Employee Employee, Date Date)
    {
        this.Rents = Rents;
        this.saleLines = saleLines;
        this.Customer = Customer;
        this.Employee = Employee;
        this.Date = Date;
        generateOrderNumber();
    }

    public Sale(ArrayList<ProductSalesLine> saleLines, Customer Customer, Employee Employee, Date Date)
    {
        this(null, saleLines, Customer, Employee, Date);
    }

    public Sale(ArrayList<Rent> Rents, ArrayList<ProductSalesLine> saleLines, Customer Customer, Employee Employee)
    {
        this(Rents, saleLines, Customer, Employee, new Date());
    }

    public Sale(ArrayList<Rent> Rents, Employee Employee, Customer Customer , Date Date)
    {
        this(Rents, null, Customer, Employee, Date);
    }

    public Sale(ArrayList<ProductSalesLine> saleLines, Customer Customer, Employee Employee)
    {
        this(null, saleLines, Customer, Employee, new Date());
    }

    public Sale(ArrayList<Rent> Rents, Employee Employee, Customer Customer)
    {
        this(Rents, null, Customer, Employee, new Date());
    }

    public boolean IsConcluded()
    {
        return IsConcluded;
    }

    public void setIsConcluded(boolean IsConcluded)
    {
        this.IsConcluded = IsConcluded;
    }

    public String getOrderNumber()
    {
        return orderNumber;
    }
    
    private void generateOrderNumber()
    {
        UUID uid = UUID.randomUUID();
        String GUID = uid.toString();
        this.orderNumber = "VB" + GUID.substring(0, 7);
    }

    public ArrayList<ProductSalesLine> getOrderSaleLines()
    {
        return saleLines;
    }
    public void setOrderSaleLines(ArrayList<ProductSalesLine> OrderSaleLines)
    {
        this.saleLines = OrderSaleLines;
    }
    public Date getDate()
    {
        return Date;
    }
    public void setDate(Date Date)
    {
        this.Date = Date;
    }
    public Actor getEmployee()
    {
        return Employee;
    }
    public void setEmployee(Employee Employee)
    {
        this.Employee = Employee;
    }
    public Customer getCustomer()
    {
        return Customer;
    }
    
    public void setCustomer(Customer Customer)
    {
        this.Customer = Customer;
    }
    
    public ArrayList<Rent> getRents()
    {
        return Rents;
    }

    public void setRents(ArrayList<Rent> Rents)
    {
        this.Rents = Rents;
    }
}